Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MC-1539] Provide backup stories for "Need to Know" feed #671

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nina-py
Copy link
Collaborator

@nina-py nina-py commented Oct 21, 2024

References

JIRA: https://mozilla-hub.atlassian.net/browse/MC-1539

Description

  • Fetch yesterday's stories if today's batch doesn't have enough "Need to Know" stories. Use time-sensitive stories from yesterday's batch.

  • Update integration tests.

PR Review Checklist

Put an x in the boxes that apply

  • This PR conforms to the Contribution Guidelines
  • The PR title starts with the JIRA issue reference, format [DISCO-####], and has the same title (if applicable)
  • [load test: (abort|warn)] keywords are applied (if applicable)
  • Documentation has been updated (if applicable)
  • Functional and performance test coverage has been expanded and maintained (if applicable)

- Fetch yesterday's stories if today's batch doesn't have enough
"Need to Know" stories. Use time-sensitive stories from yesterday's batch.

- Update integration tests.
@nina-py nina-py marked this pull request as ready for review October 23, 2024 05:42
@@ -266,6 +266,11 @@ def rank_need_to_know_recommendations(
# Filter out all time-sensitive recommendations into the need_to_know feed
need_to_know_feed = [r for r in recommendations if r.isTimeSensitive]

# If fewer than five stories have been curated for this feed, use yesterday's data
if len(need_to_know_feed) < 5:
yesterdays_recs = await self.fetch_backup_recommendations(surface_id)
Copy link
Collaborator Author

@nina-py nina-py Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially called the fetch function here directly, but split it out to be able to unit-test the parent method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant